package control;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JComboBox;
import javax.swing.JTextField;

import model.ProxyEvent;

public class EnterListener implements ActionListener {

	private ProxyEvent event;
	private JTextField eventText, date;
	private JComboBox<String> place;

	public EnterListener(ProxyEvent event, JTextField eventText,
			JTextField date, JComboBox<String> place) {
		this.event = event;
		this.eventText = eventText;
		this.date = date;
		this.place = place;

	}

	@Override
	public void actionPerformed(ActionEvent e) {

		event.setEvent(eventText.getText());

		event.setDate(Integer.parseInt(date.getText()));

		event.setPlace(place.getSelectedItem().toString());

	}

}